
import store from "../store";
export default function authenticate(path, name){
    let routerName = store.state.routerNameMap[path];
    if (!routerName) {
        return true
    }
    let buttonArr = store.state.routerButtonMap[routerName];
    if (!buttonArr) {
        return true
    }
    //找不到就返回true，那么按钮就不可用
    return buttonArr.indexOf(name) <= -1;
}